This document outlines details and specifications of the HOTspots platform designed to display and communication temporal and spatial trends in anti-microbial resistance (AMR).

Notes on the functionality

Visualisation and format requirements A choropleth (or ‘heat map’) is useful for policy and decision makers. An antibiogram and region-specific is required for practitioners. Time series data is most useful for policy but also potentially interesting to practitioners.

Notes and considerations

Future improvements:

Data

Raw data is provided from pathologists across Australia approximately once every six months. Currently there is a proforma and specific antibiotics and organisms. From now we will ask for all available data.

Currently provided to the shiny app in 4 files: 1. hotspot_monthly_data 2. hotspot_yearly_data 3. hotspot_yearly_splitage 4. hotspot_yearly_splitsex

As the names suggest, “hotspot_monthly_data” contains the date with the specific months of sampling where as the other 3 data sets begging with “hotspot_yearly_” contain the yearly aggregations.

Yearly data

In terms of the yearly data, we decided to keep the 3 data sets (aggregated by age and sex, aggregated by age but with sex, and aggregated by sex but with age groups) to minimise processing time. Only 2 of the plots required the data to be split by either age group or sex. Therefore, rather than aggregate the data within the app each time it loads, we did this once when the data was being processed. The 3 data sets very similar structures. The aggregated yearly data set has 12 columns; source, jurisdiction, region, sample_type, onset, organism, antimicrobial, year, num_of_tests_yearly, resistant_yearly, susceptible_yearly, percent_resistant_yearly , and 74245 rows.

The data set with the age groups, hotspot_yearly_splitage, includes the age_group column. The data set with the sex, hotspot_yearly_splitsex, includes the sex column.

Values for the categorial variables in the yearly data.
Variable countUnique uniqueValues
source 1 Human
jurisdiction 3 FNQ, NT, WA
region 15 Alice Springs, Cairns and Hinterland, Darwin, Gove, Katherine, Kimberley, Mackay, Mid-eastern Western Australia, North Western Queensland, Perth, Pilbara, Southern Western Australia, Tennant Creek, Torres and Cape, Townsville
sample_type 6 All, Blood, Other, Respiratory, Skin & soft tissue, Urine
onset 3 Community, Hospital, Overall
organism 13 A. baumannii, E. coli, E. faecalis, E. faecium, H. influenzae, K. pneumoniae, MRSA, MSSA, N. gonorrhoea, P. aeruginosa, S. aureus, S. pneumoniae, S. pyogenes
antimicrobial 33 Amikacin, Amoxicillin-clavulanate, Ampicillin, Azithromycin, Cefazolin, Cefepime, Cefotaxime, Cefoxitin, Ceftazidime, Ceftriaxone, Ciprofloxacin, Clindamycin, Daptomycin, Doxycycline, Erythromycin, Flucloxacillin, Gentamicin, Linezolid, MDR, Meropenem, Methicillin (proxy), Nitrofurantoin, Norfloxacin, Oxacillin, Penicillin, Piperacillin-tazobactam, Teicoplanin, Tetracycline, Ticarcillin-clavulanate, Tobramycin, Trimethoprim, Trimethoprim-sulfamethoxazole, Vancomycin
year 15 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021
age_group 8 0-5, 16-25, 26-40, 41-60, 6-15, 61-80, 81+
sex 3 , F, M
Values for the numerical variables in the yearly data.
Variable minimumValue maximumValue
num_of_tests_yearly 15 3708
resistant_yearly 0 3280
susceptible_yearly 0 3705
percent_resistant_yearly 0 100

Monthly data

For the plotting of the monthly data, it is aggregated by sample_type, onset , organism, region, antimicrobial. The plots show 1) the percent resistance “percent_resistant_monthly_raw” (y axis) against the date “date_dmy” (x axis), and 2) the number of isolates “num_of_tests_monthly_raw” (y-axis) against the date as well. Where the num_of_tests_monthly_raw is less than 15 for any month, the plots are shown with a warning regarding the interpretation of low isolate numbers.

Values for the categorial variables in the yearly data.
Variable countUnique uniqueValues
source 1 Human
jurisdiction 3 FNQ, NT, WA
region 16 Alice Springs, Cairns and Hinterland, Darwin, Gove, Katherine, Kimberley, Mackay, Mid-eastern Western Australia, Mid-western Western Australia, North Western Queensland, Perth, Pilbara, Southern Western Australia, Tennant Creek, Torres and Cape, Townsville
sample_type 6 All, Blood, Other, Respiratory, Skin & soft tissue, Urine
onset 3 Community, Hospital, Overall
organism 14 A. baumannii, CRE, E. coli, E. faecium, H. influenzae, K. pneumoniae, MRSA, MSSA, N. gonorrhoea, N. meningitidis, P. aeruginosa, S. aureus, S. pneumoniae, S. pyogenes
antimicrobial 34 Amikacin, Amoxicillin-clavulanate, Ampicillin, Azithromycin, Cefazolin, Cefepime, Cefotaxime, Cefoxitin, Ceftazidime, Ceftriaxone, Ciprofloxacin, Clindamycin, Daptomycin, Doxycycline, Erythromycin, Flucloxacillin, Gentamicin, Imipenem, Linezolid, MDR, Meropenem, Methicillin (proxy), Nitrofurantoin, Norfloxacin, Oxacillin, Penicillin, Piperacillin-tazobactam, Teicoplanin, Tetracycline, Ticarcillin-clavulanate, Tobramycin, Trimethoprim, Trimethoprim-sulfamethoxazole, Vancomycin
year 15 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021
Values for the numerical variables in the yearly data.
Variable minimumValue maximumValue
num_of_tests_monthly_raw 1 2155
resistant_monthly_raw 0 1038
susceptible_monthly_raw 0 2115
percent_resistant_monthly_raw 0 100
date_dmy 2007-01-01 2021-08-01

Here is some simulated monthly data to show the structure:

simulate_monthly <- expand.grid(
  source = "Human",
  jurisdiction = "FNQ",
  region = c("Townsville", "Cairns and Hinterland"),
  sample_type = "All",
  onset = c("Community", "Hospital"),
  organism = c("E. coli", "K. pneumoniae"),
  antimicrobial = c("Amikacin", "Cefazolin"),
  year = "2020",
  month_year = c("Jul 20", "Aug 20"), 
  num_of_tests_monthly_raw = NA,
  resistant_monthly_raw = NA,
  susceptible_monthly_raw = NA,
  percent_resistant_monthly_raw = NA,
  date_dmy = NA
)


simulate_monthly$num_of_tests_monthly_raw <- sample(1:10, size = nrow(simulate_monthly), replace = TRUE)
simulate_monthly$resistant_monthly_raw <- simulate_monthly$num_of_tests_monthly_raw - sample(1:10, size = nrow(simulate_monthly), replace = TRUE)
simulate_monthly$resistant_monthly_raw[simulate_monthly$resistant_monthly_raw < 0] <- 0
simulate_monthly$susceptible_monthly_raw <- simulate_monthly$num_of_tests_monthly_raw  - simulate_monthly$resistant_monthly_raw 
simulate_monthly$percent_resistant_monthly_raw <- (simulate_monthly$resistant_monthly_raw/simulate_monthly$num_of_tests_monthly_raw)*100

simulate_monthly$date_dmy <- as.Date(paste("01", simulate_monthly$month_year), format = "%d %b %y")

simulate_monthly %>% 
kbl(caption = "Simulated monthly data.") %>%
  kable_styling(bootstrap_options = c("striped", "condensed"))
Simulated monthly data.
source jurisdiction region sample_type onset organism antimicrobial year month_year num_of_tests_monthly_raw resistant_monthly_raw susceptible_monthly_raw percent_resistant_monthly_raw date_dmy
Human FNQ Townsville All Community E. coli Amikacin 2020 Jul 20 6 5 1 83.33333 2020-07-01
Human FNQ Cairns and Hinterland All Community E. coli Amikacin 2020 Jul 20 2 0 2 0.00000 2020-07-01
Human FNQ Townsville All Hospital E. coli Amikacin 2020 Jul 20 9 4 5 44.44444 2020-07-01
Human FNQ Cairns and Hinterland All Hospital E. coli Amikacin 2020 Jul 20 3 1 2 33.33333 2020-07-01
Human FNQ Townsville All Community K. pneumoniae Amikacin 2020 Jul 20 6 3 3 50.00000 2020-07-01
Human FNQ Cairns and Hinterland All Community K. pneumoniae Amikacin 2020 Jul 20 7 2 5 28.57143 2020-07-01
Human FNQ Townsville All Hospital K. pneumoniae Amikacin 2020 Jul 20 1 0 1 0.00000 2020-07-01
Human FNQ Cairns and Hinterland All Hospital K. pneumoniae Amikacin 2020 Jul 20 8 4 4 50.00000 2020-07-01
Human FNQ Townsville All Community E. coli Cefazolin 2020 Jul 20 2 0 2 0.00000 2020-07-01
Human FNQ Cairns and Hinterland All Community E. coli Cefazolin 2020 Jul 20 4 1 3 25.00000 2020-07-01
Human FNQ Townsville All Hospital E. coli Cefazolin 2020 Jul 20 6 0 6 0.00000 2020-07-01
Human FNQ Cairns and Hinterland All Hospital E. coli Cefazolin 2020 Jul 20 6 0 6 0.00000 2020-07-01
Human FNQ Townsville All Community K. pneumoniae Cefazolin 2020 Jul 20 3 0 3 0.00000 2020-07-01
Human FNQ Cairns and Hinterland All Community K. pneumoniae Cefazolin 2020 Jul 20 4 0 4 0.00000 2020-07-01
Human FNQ Townsville All Hospital K. pneumoniae Cefazolin 2020 Jul 20 4 2 2 50.00000 2020-07-01
Human FNQ Cairns and Hinterland All Hospital K. pneumoniae Cefazolin 2020 Jul 20 9 6 3 66.66667 2020-07-01
Human FNQ Townsville All Community E. coli Amikacin 2020 Aug 20 1 0 1 0.00000 2020-08-01
Human FNQ Cairns and Hinterland All Community E. coli Amikacin 2020 Aug 20 2 0 2 0.00000 2020-08-01
Human FNQ Townsville All Hospital E. coli Amikacin 2020 Aug 20 1 0 1 0.00000 2020-08-01
Human FNQ Cairns and Hinterland All Hospital E. coli Amikacin 2020 Aug 20 8 4 4 50.00000 2020-08-01
Human FNQ Townsville All Community K. pneumoniae Amikacin 2020 Aug 20 7 1 6 14.28571 2020-08-01
Human FNQ Cairns and Hinterland All Community K. pneumoniae Amikacin 2020 Aug 20 3 0 3 0.00000 2020-08-01
Human FNQ Townsville All Hospital K. pneumoniae Amikacin 2020 Aug 20 8 7 1 87.50000 2020-08-01
Human FNQ Cairns and Hinterland All Hospital K. pneumoniae Amikacin 2020 Aug 20 4 0 4 0.00000 2020-08-01
Human FNQ Townsville All Community E. coli Cefazolin 2020 Aug 20 6 0 6 0.00000 2020-08-01
Human FNQ Cairns and Hinterland All Community E. coli Cefazolin 2020 Aug 20 9 5 4 55.55556 2020-08-01
Human FNQ Townsville All Hospital E. coli Cefazolin 2020 Aug 20 9 1 8 11.11111 2020-08-01
Human FNQ Cairns and Hinterland All Hospital E. coli Cefazolin 2020 Aug 20 4 0 4 0.00000 2020-08-01
Human FNQ Townsville All Community K. pneumoniae Cefazolin 2020 Aug 20 7 0 7 0.00000 2020-08-01
Human FNQ Cairns and Hinterland All Community K. pneumoniae Cefazolin 2020 Aug 20 4 1 3 25.00000 2020-08-01
Human FNQ Townsville All Hospital K. pneumoniae Cefazolin 2020 Aug 20 8 3 5 37.50000 2020-08-01
Human FNQ Cairns and Hinterland All Hospital K. pneumoniae Cefazolin 2020 Aug 20 2 0 2 0.00000 2020-08-01

Spatial map

The landing page map is based on the ABS statistical area 3, with boundaries changes in QLD.

Colour palette

The colours used in the map and plots are listed and plotted below. For the heat map there are two colour palettes: the first is a green to red scheme in line with a traffic light system indicating low to high resistance. The second uses more blue-toned colours at the beginning instead of green to allow the map to be as understandable by people with red-green colour blindness. The colour blind-friendly palette was not used as the default as it has less instant association with good to bad. For the green-red heat colour palette, red was chosen to occur at 50% as the importance of AMR occurs at lower levels. This palette should be adjusted when used for alternative purposes to display a threshold important to the specific topic. Colour for all other aspects were repeated to create continuity within the platform. Regions was the variable with the most number of categories and set the total number of colours required. To reach the large number of unique colours, we adjusted the tint and tone.

hotspot_palette <- list(
  
  ## For heat map
  `heat`  = c(
    `green`         = "#629c25",
    `yellow orange` = "#FFF100", 
    `orangy yellow` = "#FFD100",
    `orange`        = "#fc8105", 
    `dark orange`   = "#e34f00",
    `red`           = "#ff0000",
    `red2`          = "#db0000",
    `deep red`      = "#C00004",
    `dark red`      = "#810000",
    `almost black`  = "#410000"),
  
  ## For heat map - colour-blind friendly
  `heat_CBfriendly` = c(
    `teal`          = "#57C4AD",
    `yellow orange` = "#E6E1BC", 
    `orangy yellow` = "#E6BD85",
    `orange`        = "#EDA247", 
    `dark orange`   = "#ED8047",
    `red`           = "#DB4325",
    `red2`          = "#db0000",
    `deep red`      = "#C00004",
    `dark red`      = "#810000",
    `almost black`  = "#410000"),
  

  ## For the regions
  `regions` = c( 
    ## QLD
    'Cairns and Hinterland'        = "#CC6677", # rose
    'Mackay'                       = "#88CCEE", #cyan 
    'North Western Queensland'     = "#44AA99", # teal
    'Torres and Cape'              = "#117733", # green
    'Townsville'                   = "#DDCC77", # sand
    #'Outback - South' = "#332288", # indigo
    #'Central Highlands (Qld)' = "#999933", # olive
    #'Rockhampton' = "#882255", # wine
    #'Biloela' = "#AA4499", # purple
    
    ## NT
    # colours lightened
    'Alice Springs'                 = "#FF8096", # rose
    'Darwin'                        = "#CCEEFF", # cyan
    'Gove'                          = "#92EFD3", # teal
    'Katherine'                     = "#CCDDAA", # green
    'Tennant Creek'                 = "#FFE57E", # sand FFEC8C
    
    ## WA 
    # colours darkened
    'Kimberley'                     = "#78343F", # rose
    'Mid-eastern Western Australia' = "#225555", # cyan 
    'Mid-western Western Australia' = "#36877A", # teal
    'Perth'                         = "#225522", # green
    'Pilbara'                       = "#A59858", # sand
    'Southern Western Australia'    = "#222255" # indigo
    
    ## Overall - grey scale
    # 'NT overall'  = "#404040", # darkest grey
    # 'FNQ overall' = "#5e5d5d", # dark grey 
    # 'WA overall'  = "#757575", #  grey
    # 'NSW overall'  = "#8a8a8a",
    # 'ACT overall' = "#9e9e9e", 
    # 'VIC overall'  = "#b5b5b5" # light grey
    # 'SA overall' = "#cfcfcf", # lightest grey
    # 'TAS overall'  = "#242424" # deep deep dark grey
    
    ## Overall - coloured
    # 'FNQ'   = "#44AA99", # teal
    # 'NT'    = "#332288", # indigo
    # 'WA'    = "#78343F" # rose
    
    ## Other colours available to use
    
    # colours lightened
    #'region name' = "#8183E6", # indigo
    #'region name' = "#C5C86E", # olive
    #'region name' = "#F488EE", # purple
    
    # colours darkened
    #'region name' = "#2F345B", # indigo
    #'region name' = "#7B7B29", # olive
    #'region name' = "#781D4A", # wine
    #'region name' = "#803273", # purple
    
  ),
  
  # For the Jurisdictions
  `jurisdiction` = c( 'FNQ'   = "#44AA99", # teal
                      'NT'    = "#332288", # indigo
                      'WA'    = "#78343F", # rose
                      'Far North Queensland' = "#44AA99", # teal
                      'Nothern Australia'    = "#332288", # indigo
                      'Western Australia'    = "#78343F" # rose
                      #'NSW' = "#225555" #cyan
                      #'VIC' = "#225522" #green
                      #'ACT' = "#999933" #olive
                      #'TAS' = "#A59858" #sand
                      #''    = "#781D4A", # wine
                      #''    = "#803273", # purple
  ), 

  # For the Jurisdictions
  `jurisdiction_range` = c( 'FNQ' = "#92EFD3", # teal
                            'NT'  = "#8183E6", # indigo
                            'WA'  = "#FF8096"), # rose
  #'NSW'  = "#CCEEFF" #cyan
  #'VIC'  = "#CCDDAA" #green
  #'ACT'  = "#C5C86E" #olive
  #'TAS'  = "#FFE57E" #sand
  
  ## For the onset locations
  `onset` = c('Overall'   = "#332288" , # indigo
              'Hospital'  = "#88CCEE", # cyan
              'Community' = "#44AA99"), # teal
  
  ## For the sample types
  `sample` = c('All'                = "#332288" , # indigo
               'Blood'              = "#88CCEE", # cyan
               'Other'              = "#44AA99", # teal
               'Respiratory'        = "#117733", # green
               'Skin & soft tissue' = "#A0515E", # rose
               'Urine'              = "#999933"), #olive
  
  ## For the age brackets
  `age` = c('0-5'     = "#332288" , # indigo
            '6-15'    = "#88CCEE", # cyan
            '16-25'   = "#44AA99", # teal
            '26-40'   = "#117733", # green
            '41-60'   = "#A0515E", # rose
            '61-80'   = "#DDCC77", # sand
            '81+'     = "#999933", # olive
            'unknown' = "#803273" # purple
            
  ), 
  
  `year` = c( 
    `light red`     = "#FFE0E2",
    `red`           = "#ff0000",
    `dark red`      = "#810000"),
  
  # For the sexes
  `sex` = c( 'M'    = "#44AA99", # teal
             'F'  = "#332288", # indigo
             'Overall' = "#999933",
             
             # repeated with the names changed
             'Male'    = "#44AA99", # teal
             'Female'  = "#332288", # indigo
             'Both' = "#999933") # olive
)